<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上传成功</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            /* 背景图：将 ./images/bg.jpg 替换为你的图片路径（相对路径或绝对 URL） */
            background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)), url('./Resource/bg.png') center/cover no-repeat fixed;
        }
        
        .success-container {
            background-color: white;
            padding: 40px;
            border-radius: 8px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            width: 400px;
            text-align: center;
        }
        
        h1 {
            color: #2ecc71;
            margin-bottom: 20px;
        }
        
        .success-message {
            margin-bottom: 20px;
            line-height: 1.6;
        }
        
        .user-info {
            background-color: #f9f9f9;
            padding: 15px;
            border-radius: 4px;
            margin: 20px 0;
            text-align: left;
        }
        
        .info-item {
            margin-bottom: 10px;
        }
        
        .info-label {
            font-weight: bold;
            color: #555;
        }
        
        button {
            padding: 10px 20px;
            background-color: #4a90e2;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        
        button:hover {
            background-color: #3a7bc8;
        }
    </style>
</head>
<body>
    <div class="success-container">
        <h1>上传成功！</h1>
        <div class="success-message">
            欢迎使用我们的系统，您已成功上传。
        </div>
        
        <div class="user-info" id="userInfo">
            <!-- 用户信息将通过JavaScript动态填充 -->
        </div>
        
        <button id="logoutBtn">返回</button>
    </div>

    <script>
        // 解析URL参数
        function getQueryParams() {
            const params = new URLSearchParams(window.location.search);
            return {
                name: params.get('name') || '未提供',
                idCard: params.get('idCard') ? hideIdCard(params.get('idCard')) : '未提供',
                projectId: params.get('projectId') || '未提供'
            };
        }
        
        // 隐藏身份证号中间部分
        function hideIdCard(idCard) {
            if (idCard.length !== 18) return idCard;
            return idCard.substring(0, 6) + '********' + idCard.substring(14);
        }
        
        // 显示用户信息
        function displayUserInfo() {
            const userInfo = getQueryParams();
            const userInfoDiv = document.getElementById('userInfo');
            
            userInfoDiv.innerHTML = `
                <div class="info-item">
                    <span class="info-label">姓名:</span> ${userInfo.name}
                </div>
                <div class="info-item">
                    <span class="info-label">身份证号:</span> ${userInfo.idCard}
                </div>
                <div class="info-item">
                    <span class="info-label">项目ID:</span> ${userInfo.projectId}
                </div>
            `;
        }
        
        // 页面加载时显示用户信息
        window.onload = displayUserInfo;
        
        // 返回登录按钮事件
        document.getElementById('logoutBtn').addEventListener('click', function() {
            window.location.href = './Homepage.html';
            
        });
    </script>
</body>
</html>